home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
elk-2_0.lha
/
elk-2.0
/
examples
/
scheme
/
fact
< prev
next >
Wrap
Text File
|
1989-02-17
|
197b
|
12 lines
;;; -*-Scheme-*-
(define (factorial n)
(define (iter product counter)
(if (> counter n)
product
(iter (* counter product)
(+ counter 1))))
(iter 1 1))
(print (factorial 10))